import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useMessagesStore = defineStore('messages', () => {
  const currentUser = 'user1'
  const otherUser = 'user2'

  // 消息
  const messages = ref([
    { id: 1, user: currentUser, text: '你好！' },
    { id: 2, user: otherUser, text: '你好，有什么可以帮您？' },
  ])

  return { messages, currentUser, otherUser }
})
